package com.eqdd.yiqidian.ui.share;

import android.databinding.DataBindingUtil;
import android.view.View;

import com.eqdd.yiqidian.JiaoziVideoPlayActivityCustom;
import com.eqdd.yiqidian.R;
import com.eqdd.yiqidian.base.BaseActivity;
import com.eqdd.yiqidian.base.Config;

import cn.jzvd.JZVideoPlayer;
import cn.jzvd.JZVideoPlayerStandard;

public class JiaoziVideoPlayActivity extends BaseActivity {
    private JiaoziVideoPlayActivityCustom dataBinding;
    private String url;

    @Override
    public void initBinding() {
        dataBinding = DataBindingUtil.setContentView(this, R.layout.activity_jiaozi_video_play);
        initTopTitleBar(View.VISIBLE, "");
    }

    @Override
    public void initData() {
        url = getIntent().getStringExtra(Config.VIDEO_URL);

        JZVideoPlayerStandard jzVideoPlayerStandard = (JZVideoPlayerStandard) findViewById(R.id.videoplayer);
        jzVideoPlayerStandard.setUp(url
                , JZVideoPlayerStandard.SCREEN_LAYOUT_NORMAL, "录音");
//        ImageUtil.setImage("http://p.qpic.cn/videoyun/0/2449_43b6f696980311e59ed467f22794e792_1/640",jzVideoPlayerStandard.thumbImageView);
        jzVideoPlayerStandard.startVideo();

    }

    @Override
    public void setView() {

    }

    @Override
    public void onClick(View v) {
        super.onClick(v);
        switch (v.getId()) {

        }
    }

    @Override
    public void onBackPressed() {
        if (JZVideoPlayer.backPress()) {
            return;
        }
        super.onBackPressed();
    }

    @Override
    protected void onPause() {
        super.onPause();
        JZVideoPlayer.releaseAllVideos();
    }
}
